package com.yami.shop.personnft.common.service.impl;


import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yami.shop.personnft.common.dao.TransferBatchApplyMapper;
import com.yami.shop.personnft.common.model.TransferBatchApply;
import com.yami.shop.personnft.common.service.TransferBatchApplyService;
import lombok.extern.slf4j.Slf4j;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
@Slf4j
public class TransferBatchApplyServiceImpl implements TransferBatchApplyService {
    @Autowired
    private TransferBatchApplyMapper transferBatchApplyMapper;

    @Override
    public void save(TransferBatchApply transferBatchApply) {
        transferBatchApplyMapper.save(transferBatchApply);
    }

    @Override
    public void saveBatch(List<TransferBatchApply> list) {
        transferBatchApplyMapper.saveBatch(list);
    }

    @Override
    public void updateBatch(List<TransferBatchApply> list) {
        transferBatchApplyMapper.updateBatch(list);
    }

    @Override
    public void updateIntoStautsByBatchId(Long batchId, Integer status, String msg,Integer times) {
        transferBatchApplyMapper.updateIntoStautsByBatchId(batchId,status,msg,times);
    }

    @Override
    public TransferBatchApply selectIntoStautsByBatchId(Long batchId) {
        return transferBatchApplyMapper.selectIntoStautsByBatchId(batchId);
    }

    @Override
    public List<TransferBatchApply> selectListByApplyId(String applyId) {
        return transferBatchApplyMapper.selectListByApplyId(applyId);
    }
    @Override
    public Integer selectCountByApplyId(String applyId) {
        return transferBatchApplyMapper.selectCountByApplyId(applyId);
    }

    @Override
    public String selectProportionByApplyId(String applyId) {
        return transferBatchApplyMapper.selectProportionByApplyId(applyId);
    }

    @Override
    public IPage<TransferBatchApply> selectPageList(Page page, TransferBatchApply transferBatchApply) {
        IPage<TransferBatchApply> doPage = transferBatchApplyMapper.selectPageList(page,transferBatchApply);
        return doPage;
    }

    @Override
    public void updateTimesByBatchId(Long batchId) {
        transferBatchApplyMapper.updateTimesByBatchId(batchId);
    }

    @Override
    public void updateIntoSurplusContentByBatchId(Long batchId, Integer times, String surplusContent) {
        transferBatchApplyMapper.updateIntoSurplusContentByBatchId(batchId,times,surplusContent);
    }

    @Override
    public void updateIntoStautsByBatchIds( List<Long> batchIds,Integer status) {
        transferBatchApplyMapper.updateIntoStautsByBatchIds(batchIds,status);
    }
}
